package com.example.order.controller.v1;

import com.example.model.order.pojo.OrderDO;
import com.example.order.service.OrderService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 订单 前端控制层
 *
 * @author Lv
 * @date 2023/10/02
 */
@Api(tags = "订单")
@RestController
@RequestMapping("/api/v1/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    /**
     * 获取详情
     *
     * @param id 订单id
     * @return
     */
    @GetMapping("/get/{id}")
    public OrderDO get(@PathVariable("id") Long id) {
        return orderService.getById(id);
    }

    /**
     * 测试用户接口RPC调用
     *
     * @return
     */
    @PostMapping("/test_rpc")
    public String testUserRpc() {
        return orderService.testUserRpc();
    }
}

